/**
 * 
 */
package com.xsoft.logic.service.implement.sys.user;


import java.util.ArrayList;
import java.util.List;


import com.xsoft.framework.service.BaseService;
import com.xsoft.logic.model.sys.Root;
import com.xsoft.logic.model.sys.User;
import com.xsoft.logic.model.sys.UserRoleFlag;
import com.xsoft.logic.service.interfaces.sys.user.UserService;


/**
 * @author 潘冬 2010-8-6 下午03:32:26
 */
public class UserServiceImpl extends BaseService implements UserService {
	
	private String selectUserByName;
	private String selectUserRoleByUserId;
	private String deleteUserRole;
	private String deleteUserPrivilege;
	
	public String getDeleteUserRole() {
		return deleteUserRole;
	}


	public void setDeleteUserRole(String deleteUserRole) {
		this.deleteUserRole = deleteUserRole;
	}


	public String getDeleteUserPrivilege() {
		return deleteUserPrivilege;
	}


	public void setDeleteUserPrivilege(String deleteUserPrivilege) {
		this.deleteUserPrivilege = deleteUserPrivilege;
	}


	@Override
	public List<UserRoleFlag> selectUserRoleByUserId(Long id) {
		return (List<UserRoleFlag>) this.dao.findForList(selectUserRoleByUserId, id);
	}
	
	


	@Override
	public String getTableName() {
		// TODO Auto-generated method stub
		return "User";
	}

	@Override
	public User selectUserByName(String name) {
		// TODO Auto-generated method stub
		return (User) dao.getObject(selectUserByName, name);
	}


	public String getSelectUserByName() {
		return selectUserByName;
	}


	public void setSelectUserByName(String selectUserByName) {
		this.selectUserByName = selectUserByName;
	}

	public String getSelectUserRoleByUserId() {
		return selectUserRoleByUserId;
	}


	public void setSelectUserRoleByUserId(String selectUserRoleByUserId) {
		this.selectUserRoleByUserId = selectUserRoleByUserId;
	}


	@Override
	public void deleteUserPrivilege(Long userId) {
		dao.remove(deleteUserPrivilege, userId);
		
	}


	@Override
	public void deleteUserRole(Long userId) {
		// TODO Auto-generated method stub
		dao.remove(deleteUserRole, userId);
	}


}
